package com.wholesale;


import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.ViewFlipper;

public class AboutLayout extends LinearLayout implements OnClickListener {   
	private ViewFlipper viewFlipper ;
	private Context context ;
	private View baseView ;
	private Button leftButton ;
	private Button rightButton ;
	private TextView headView ;
	
	//  构造函数  
	public AboutLayout(Context context,final ViewFlipper viewFlipper){
		super(context);
		this.viewFlipper = viewFlipper ;
		this.context = context ;
		//加载需要的属性，加载方法一的子Layout  
		baseView = ((Activity) getContext()).getLayoutInflater().inflate(R.layout.about, this);  
		leftButton = (Button)baseView.findViewById(R.id.leftBtn);
		leftButton.setText("More");
		leftButton.setOnClickListener(this);
		rightButton = (Button)baseView.findViewById(R.id.rightBtn);
		rightButton.setVisibility(View.INVISIBLE);
		headView = (TextView)baseView.findViewById(R.id.title);
		headView.setText("About");
		TextView copyRightTime = (TextView)baseView.findViewById(R.id.copyrighttime);
		copyRightTime.setText("© 2005-2011");
		TextView copyRight = (TextView)baseView.findViewById(R.id.copyright);
		copyRight.setText("Wholesale-dress.net Copyright.All Rights Reserved");
	}

	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.leftBtn:
			viewFlipper.showPrevious();
			viewFlipper.removeView(this);
			break;
		case R.id.rightBtn:
			
			break;
		default:
			break;
		}
		
	}
}
